FROM debian:12.12-slim
LABEL author=xiaoyilin
LABEL email=406735078@qq.com
ARG GCC_VERSION=12.5.0
ADD gcc-${GCC_VERSION}.tar.gz Hello.cpp /usr/local/
WORKDIR /usr/local/gcc-${GCC_VERSION}/
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
apt-get -y update && apt-get install -y libmpc3 && rm -rf /var/lib/apt/lists/*
ENV TZ=Asia/Shanghai
ENV PATH=$PATH:/usr/local/gcc-${GCC_VERSION}/bin
CMD ["g++","-v"]
# tar -czvf gcc12.5.0.tar.gz gcc12.5.0/
# docker build --build-arg GCC_VERSION=12.5.0 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/gcc:12.5.0 .
# docker build --build-arg GCC_VERSION=13.4.0 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/gcc:13.4.0 .
# docker build --build-arg GCC_VERSION=14.3.0 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/gcc:14.3.0 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/gcc:12.5.0
# docker run -it --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/gcc:12.5.0 bash
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/gcc:12.5.0
# g++ -o hello /usr/local/Hello.cpp -std=c++20
# echo | g++ -v -x c++ -E -

# https://www.gnu.org/prep/ftp.html#asia
# https://mirrors.ustc.edu.cn/gnu/gcc/